﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="website_admin_members_membersmaglist" Codefile="membersmaglist.aspx.cs" %>

<%@ Register Src="../../admin/_root/_controls/ctlNavBar.ascx" TagName="ctlNavBar"
    TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>

    <script src="../_common/scripts/jquery-1.4.1.min.js" type="text/javascript"></script>

    <script type="text/javascript" language="javascript" src="../_common/scripts/util.js"></script>

    <link href="../../_common/styles/form_2_0.css" rel="stylesheet" type="text/css" />
    <link href="../../_common/flexigrid/flexigrid_blue.css" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript">
        var pre_scrollLeft = 0;
        $(document).ready(setup);
        function setup() {
            LoadingData();
        }
        /// 自动校对左右滚动条
        $(window).resize(function () {
            if (document.getElementById("scrool_left1")) {
                if (pre_scrollLeft != document.getElementById("scrool_left1").scrollLeft) {
                    pre_scrollLeft = document.getElementById("scrool_left1").scrollLeft;
                    $(".hDivBox").css("margin-left", -pre_scrollLeft);
                }
            }
        });

        function ItemSelected(_obj) {
            var _itemsId = document.getElementById("txtItemsId");

            if (_obj.checked) {
                if (_itemsId.value.indexOf("'" + _obj.oid + "'") == -1) {
                    _itemsId.value += "'" + _obj.oid + "',";
                }
                $("#" + _obj.id).parent().parent().parent().addClass("trSelected");
            }
            else {
                _itemsId.value = _itemsId.value.replace("'" + _obj.oid + "',", "");
                $("#" + _obj.id).parent().parent().parent().removeClass("trSelected");
            }
        }
        function SelectedAllItems() {
            var _itemsId = document.getElementById("txtItemsId");

            $("input[name='cbxItems']").each(function () {
                if (!$(this).attr("disabled")) {
                    _objectid = $(this).attr("oid");

                    if (!$(this).attr("checked")) {
                        $(this).attr("checked", true);

                        /// 加入队列
                        if (_itemsId.value.indexOf("'" + _objectid + "'") == -1) {
                            _itemsId.value += "'" + _objectid + "',";
                        }
                        $(this).parent().parent().parent().addClass("trSelected");
                    }
                    else {
                        $(this).attr("checked", false);
                        _itemsId.value = _itemsId.value.replace("'" + _objectid + "',", "");
                        $(this).parent().parent().parent().removeClass("trSelected");
                    }
                }
            });
        }
        function DeleteItems(_obj) {
            if (confirm("Are you sure you want to delete the selected record?")) {
                var _itemsId = document.getElementById("txtItemsId").value;
                if (_itemsId != "") {
                    _itemsId += "|";
                    _itemsId = _itemsId.replace(",|", "").replace("'", "").replace("'", "");

                    $.ajax({
                        async: false,
                        type: "POST",
                        url: "membersmaglist.aspx",
                        data: {
                            otype: "deleteitems",
                            itemsid: _itemsId
                        },
                        success: function (data, textStatus) {
                            if (data == "succeeded") {
                                alert("Successfully removed!");
                                $("#txtItemsId").val("");
                                LoadingData();
                            }
                            else {
                                alert(data);
                            }
                        }
                    });
                }
                else
                    alert("Please select a record to be deleted!");
            }
        }
        var pageIndex = "1";
        var pageSize = 10;
        /// 分页
        function pagination(index) {
            pageIndex = index;
            LoadingData();
        }
        /// 查询
        function Search() {
            pageIndex = 1;
            LoadingData();
        }
        /// 每页显示记录数设定
        function ChangePagesize(rp) {
            pageSize = rp.value;
            LoadingData();
        }
        function LoadingData() {
            $.ajax({
                async: true,
                type: "POST",
                url: "membersmagList.aspx",
                data: {
                    index: pageIndex,
                    pagesize: pageSize,
                    otype: "loadingdata",
                    username: $("#txtUsername").val(),
                    isapproved: $("#selIsApproved").val(),
                    islockedout: $("#selIsLockedOut").val()
                },
                beforeSend: function () {
                    $("#divItemsList").html("<div class=\"tDiv\"></div>" + $("#divTreeLoading").html() + "<div class=\"pDiv\"></div>");
                },
                success: function (data, textStatus) {
                    $("#divItemsList").html("");
                    $("#divItemsList").html(data);
                }
            });
        }
        function OpenDia(otype) {
            var groupid = getUrlParam("groupid");
            switch (otype) {
                case "add":
                    window.location.href = "memberinfoeditor.aspx?otype=add&groupid=" + groupid;
                    break;
            }
        }
        function OpenDia(otype, objectid) {
            var groupid = getUrlParam("groupid");
            switch (otype) {
                case "add":
                    openStdWin(prependOrgName("/website_admin/members/memberinfoeditor.aspx?otype=add"), buildWinName(), 990, 670);
                    break;
                case "modify":
                    openStdWin(prependOrgName("/website_admin/members/memberinfoeditor.aspx?otype=modify&userid=" + objectid), buildWinName(), 990, 670);
                    break;
                case "preview":
                    window.open(prependOrgName("/productinfo.aspx?pid=" + objectid));
                    break;
            }
        }

        function Delete(_objectId) {
            if (confirm("你确定要执行删除操作?")) {
                $.ajax({
                    async: false,
                    type: "POST",
                    url: "membersmaglist.aspx",
                    data: {
                        otype: "delete",
                        objectId: _objectId
                    },
                    success: function (data, textStatus) {
                        if (data == "succeeded") {
                            alert("删除操作完成！");
                            LoadingData();
                        }
                        else {
                            alert(data);
                        }
                    }
                });
            }
        }

        function ChangePassword(_username, _userid) {
            openStdDlg("changepassword.aspx?username=" + _username + "&userid=" + _userid + "&otype=changepassword", window, 345, 175);
        }
    </script>

</head>
<body scrool="no" style="margin: 0px; padding: 0px;">
    <div id="divTreeLoading" style="display: none;">
        <div class="bDiv" style="height: 320px;">
            <div style="background-color: #FFFFFF; table-layout: fixed; width: auto; height: 100%; text-align: center; margin-top: 30px;">
                <img border="0" src="../_imgs/admin/progress.gif" />
                <span style="line-height: 42px;">Loading ... </span>
            </div>
        </div>
    </div>
    <form id="Form1" runat="server">
    <input name="txtItemsId" type="hidden" id="txtItemsId" />
    <div class="divAreas">
        <div class="boxTopBar_1">
            <div class="navBar">
                <uc1:ctlNavBar ID="ctlNavBar2" runat="server" />
            </div>
        </div>
        <table cellpadding="0" cellspacing="0" class="stdTable" style="width: 100%;">
            <tbody>
                <tr>
                    <td valign="top" style="padding: 8px 5px 0px;">
                        <table class="stdTable" cellpadding="0" cellspacing="0">
                                    <colgroup>
                                        <col style="padding-right: 5px; text-align: right; width: 60px;" />
                                        <col style="width: 120px;" /> 
                                        <col style="padding-right: 5px; text-align: right; width: 70px;" />
                                        <col style="width: 80px;" />
                                        <col style="padding-right: 5px; text-align: right; width: 70px;" />
                                        <col style="width: 80px;" />
                                        <col style="width: 80px; padding-left: 5px;" />
                                        <col style="text-align: right;" />
                                    </colgroup>
                                    <tr>
                                        <td>
                                            用户名：
                                        </td>
                                        <td>
                                            <input type="text" id="txtUsername" name="txtUsername" class="textBox" />
                                        </td> 
                                        <td>
                                            审核状态：
                                        </td>
                                        <td>
                                            <select id="selIsApproved" name="selStockStatus" class="SelectBox">
                                                <option value="">-- 全部 --</option>
                                                <option value="1">已审核</option>
                                                <option value="0">未审核</option>
                                            </select>
                                        </td>
                                        <td>
                                            帐号状态：
                                        </td>
                                        <td>
                                            <select id="selIsLockedOut" name="selIsLockedOut" class="SelectBox">
                                                <option value="">-- 全部 --</option>
                                                <option value="1">锁定</option>
                                                <option value="0">活动</option>
                                            </select>
                                        </td>
                                        <td>
                                            <input id="Button1" class="btn_s" value="查 询" type="button"
                                                onclick="Search();" />
                                        </td>
                                        <td>
                                          
                                        </td>
                                    </tr>
                                </table>
                    </td>
                </tr>
                <tr style="height: 100%;">
                    <td valign="top" style="padding: 5px 5px 0px;">
                        <div class="flexigrid" id="divItemsList">
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    </form>
</body>
</html>



    
<%--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title></title>

    <script src="../_common/scripts/jquery-1.4.1.min.js" type="text/javascript"></script>

    <script type="text/javascript" language="javascript" src="../_common/scripts/util.js"></script>

    <link href="../_common/styles/frame_global.css" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript">
        function window.onload() {
            LoadingData(); 
        }
        function Search()
        {
            pageIndex = "1";
            LoadingData();
        }
        var pageIndex = "";
        function pagination(index)
        {
            pageIndex = index;
            LoadingData();
        }
        function LoadingData() {
            $.ajax({
                async: true,
                type: "POST",
                url: "membersmaglist.aspx",
                data: {
                    index: pageIndex,
                    otype: "loadingdata",
                    username: $("#txtUsername").val(),
                    isapproved: $("#selIsApproved").val(),
                    islockedout: $("#selIsLockedOut").val()
                },
                beforeSend: function() {
                    $("#divLoading").css("display", "block");
                    $("#divItemsList").html("");
                },
                success: function(data, textStatus) {
                    $("#divLoading").css("display", "none");
                    $("#divItemsList").html(data);
                }
            });
        }
        function Delete(_objectId) { 
            if(confirm("你确定要执行删除操作?"))
            {
               $.ajax({
                    async: false,
                    type: "POST",
                    url: "membersmaglist.aspx",
                    data: {
                        otype: "delete",
                        objectId: _objectId
                    },
                    success: function(data, textStatus) { 
                        if (data == "succeeded") {
                            alert("删除操作完成！");
                            LoadingData();
                        }
                        else {
                            alert(data);
                        }
                    }
                });
            }
        } 
        function OpenDia(otype)
        {
            var groupid=getUrlParam("groupid");
            switch(otype)
            {
                case "add":
                    window.location.href="memberinfoeditor.aspx?otype=add&groupid="+groupid;
                    break;
            }
        }
        function Modify(objectId)
        {
            window.location.href="memberinfoeditor.aspx?otype=modify&groupid="+getUrlParam("groupid")+"&userid="+objectId;
        } 
        function View(objectId)
        {
            window.location.href="memberinfoeditor.aspx?otype=modify&groupid="+getUrlParam("groupid")+"&userid="+objectId;
        }
        function ChangePassword(_username, _userid)
        {
            openStdDlg("changepassword.aspx?username=" + _username + "&userid=" + _userid + "&otype=changepassword", window, 345, 175);
        }
    </script>

</head>
<body>
    <form id="aspnetForm" runat="server">
    <div class="divAreas">
        <div class="boxTopBar">
            <div class="boxTopBarLeft">
                <div class="navBar">
                    <uc1:ctlNavBar ID="ctlNavBar1" runat="server" />
                </div>
            </div>
            <div class="boxTopBarRight">
            </div>
        </div>
        <div class="boxMain">
            <div class="boxMainBody">
                <table cellpadding="0" cellspacing="0" class="stdTable" style="width: 98%;">
                    <tbody>
                        <tr style="height: 32px;">
                            <td style="padding: 0px 5px 0px;">
                                <table class="stdTable" cellpadding="0" cellspacing="0">
                                    <colgroup>
                                        <col style="padding-right: 5px; text-align: right; width: 60px;" />
                                        <col style="width: 120px;" /> 
                                        <col style="padding-right: 5px; text-align: right; width: 70px;" />
                                        <col style="width: 80px;" />
                                        <col style="padding-right: 5px; text-align: right; width: 70px;" />
                                        <col style="width: 80px;" />
                                        <col style="width: 80px; padding-left: 5px;" />
                                        <col style="text-align: right;" />
                                    </colgroup>
                                    <tr>
                                        <td>
                                            用户名：
                                        </td>
                                        <td>
                                            <input type="text" id="txtUsername" name="txtUsername" class="textBox" />
                                        </td> 
                                        <td>
                                            审核状态：
                                        </td>
                                        <td>
                                            <select id="selIsApproved" name="selStockStatus" class="SelectBox">
                                                <option value="">-- 全部 --</option>
                                                <option value="1">已审核</option>
                                                <option value="0">未审核</option>
                                            </select>
                                        </td>
                                        <td>
                                            帐号状态：
                                        </td>
                                        <td>
                                            <select id="selIsLockedOut" name="selIsLockedOut" class="SelectBox">
                                                <option value="">-- 全部 --</option>
                                                <option value="1">锁定</option>
                                                <option value="0">活动</option>
                                            </select>
                                        </td>
                                        <td>
                                            <input id="Button1" class="btn_s" value="查 询" type="button"
                                                onclick="Search();" />
                                        </td>
                                        <td>
                                            <input id="Button2" class="btn_s" value="新增会员" type="button" onclick="OpenDia('add');" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr style="height: 100%;">
                            <td valign="top" style="padding: 5px 5px 0px;">
                                <table cellpadding="0" cellspacing="0" class="Form-Gruid" align="center" style="height: 100%;">
                                    <tbody>
                                        <tr>
                                            <td style="background: #ffffff; vertical-align: top;">
                                                <div id="divLoading" style="display: none;">
                                                    <table style="background-color: #FFFFFF; border: solid 1px #eoeoeo; table-layout: fixed;
                                                        width: 100%; height: 100%;" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td style="vertical-align: middle" align="center">
                                                                <img src="../_imgs/admin/progress.gif" /><br />
                                                                加载数据 ...
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                                <div id="divItemsList">
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="boxBottomBar">
            <div class="boxBottomBarLeft">
                &nbsp;
            </div>
            <div class="boxBottomBarRight">
                &nbsp;
            </div>
        </div>
    </div>
    </form>
</body>
</html>--%>


